﻿@model DataAnnotationsExample.Models.Contato
<style>
    .marginBottom{margin-bottom:10px;}
</style>
<div class="row">
    <div class="col-md-4">
        <div>
            @using (Html.BeginForm("CadastrarContato", "Home", FormMethod.Post))
            {
                <fieldset>
                    <legend>Cadastro de Contato</legend>

                    <div class="form-group">
                        <div class="col-sm-10 marginBottom">
                            @Html.LabelFor(model => model.Nome)
                            @Html.TextBoxFor(model => model.Nome, new { @class = "form-control" })
                            @Html.ValidationMessageFor(model => model.Nome)
                        </div>
                        <div class="col-sm-10 marginBottom">
                            @Html.LabelFor(model => model.Idade)
                            @Html.TextBoxFor(model => model.Idade, new { @class = "form-control" })
                            @Html.ValidationMessageFor(model => model.Idade)
                        </div>
                        <div class="col-sm-10 marginBottom">
                            @Html.LabelFor(model => model.Email)
                            @Html.TextBoxFor(model => model.Email, new { @class = "form-control" })
                            @Html.ValidationMessageFor(model => model.Email)
                        </div>
                        <div class="col-sm-10 marginBottom">
                            <input type="submit" value="Salvar" class="btn btn-medium btn-primary" />
                        </div>
                    </div>
                </fieldset>
            }
        </div>
    </div>
</div>

<script src="~/Scripts/jquery-1.10.2.min.js"></script>
<script src="~/Scripts/jquery.validate.js"></script>
<script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script>